-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Emit MsgsNoticed on receipt of an IMAP-seen message #6351
Conversation
`imap::Session::sync_seen_flags()` emits `MsgsNoticed` for existing messages seen on other devices, so `receive_imf` should do the same when it receives a seen message. Otherwise a multi-device user may see a new message notification on device A, just swipe it, then see another new message notification and mark it as read, and when their device B goes online, it will show a notification for the first message, and it won't be removed because `MsgsNoticed` isn't emitted. I have checked this with my DC Android and Desktop. With this fix the notification should be removed at least.
This PR would mean that when any messages with state Since all of this is a very small bug, I suggest to simply not fix it at all. One could even argue that this is the correct behavior (after all, the first notification was only swiped away, not marked as read, so the message should be notified on the other device). |
Received MDNs and reactions aren't messages currently, |
To me, the code very much looks like the MsgsNoticed event would still have been emitted, since we don't early-return from receive_imf in this case, even if chat_id is trash. Anyway, before merging a PR like this, we would have had to test this on a real device (not just read the code) in order not to risk introducing a severe bug. But as I said, I don't think it's worth it spending energy on this, things are fine already. |
#6213 will fix the problem of reactions being shown on multiple devices. The problem of wrong notifications of older reactions that got changed is probably easier fixed in the UI, at least I can't come up with a sensible way how core could help with that. FTR, if we have an actual user value for emitting MsgsNoticed on receipt of an IMAP-seen message, and test that MsgsNoticed is not emitted for every reaction and mdn, then I'm not against it. |
True, it will be emitted even for MDNs, but with
The problem is that the code is inconsistent already now. I can't understand why The current problem is that EDIT: I re-read the code again and now i've understood why we emit Then anyway we should reopen the PR because in |
Recreated the PR: #6415. Can't reopen this one because i force-pushed the branch or maybe recreated it. |
imap::Session::sync_seen_flags()
emitsMsgsNoticed
for existing messages seen on other devices, soreceive_imf
should do the same when it receives a seen message. Otherwise a multi-device user may see a new message notification on device A, just swipe it, then see another new message notification and mark it as read, and when their device B goes online, it will show a notification for the first message, and it won't be removed becauseMsgsNoticed
isn't emitted. I have checked this with my DC Android and Desktop. With this fix the notification should be removed at least.EDIT: The fix doesn't help DC Desktop not show a notification for the first message. I didn't check Android though. Anyway,
MsgsNoticed
was missing obviously.